package com.woniuxy.service.impl;

import com.woniuxy.dao.RbacManagerDao;
import com.woniuxy.entity.RbacManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @author: mayuhang  <br/>
 * Date: 2021/4/22:23:33  <br/>
 * Description: 用于用户登录验证
 */
@Component
public class UserService {
    @Autowired(required = false)
    RbacManagerDao rbacManagerDao;

//    @Cacheable(value = "rbacManager",key = "#username")
    public RbacManager getUser(String username){
        //去数据库查询如果  没有这个用户则返回空 代码略
        RbacManager rbacManager = rbacManagerDao.queryByAccount(username);

        return rbacManager;
    }
}
